package com.woniuxy.platform.core.controller;


import com.woniuxy.common.CommonResult;
import com.woniuxy.platform.core.model.PmMenu2;
import com.woniuxy.platform.core.service.PmMenu2Service;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-07-12
 */
@RestController
@RequestMapping("/pmMenu2")
public class PmMenu2Controller {

    @Resource
    private PmMenu2Service service;

    @ApiOperation("平台端菜单查询")
    @GetMapping("selectMenu")
    public CommonResult selectMenu(){
        List<PmMenu2> list = this.service.selectAll();
        if (list == null){
            return CommonResult.fail("查询平台端菜单失败");
        }
        return CommonResult.success(list);
    }

}

